package game.square;



import static org.junit.Assert.*;

import org.junit.*;

public class DoorTest {
	
	private Door closedDoor,openDoor;

	/**
	 * Set up a mutable test fixture.
	 * 
	 */
	@Before
	public void setUp() throws Exception {
		closedDoor = new Door();
		openDoor = new Door();
		openDoor.open();
	}
	
	@Test
	public final void constructor_SingleCase(){
		Door door = new Door();
		assertFalse(door.isOpen());
		assertFalse(door.isSlippery());
		assertTrue(door.isCreated());
	}
	
	@Test
	public final void isOpenable_SingleCase(){
		assertTrue(closedDoor.isOpenable());
	}
	
	@Test
	public final void getNewEqualBorder_ClosedDoor(){
		Border equalBorder = closedDoor.getNewEqualBorder();
		assertEquals(Door.class,equalBorder.getClass());
		assertFalse(((Door)equalBorder).isOpen());
	}
	
	@Test
	public final void getNewEqualBorder_OpenDoor(){
		Border equalBorder = openDoor.getNewEqualBorder();
		assertEquals(Door.class,equalBorder.getClass());
		assertTrue(((Door)equalBorder).isOpen());
	}
	

	
	
}
